package org.hawk.gwtppc.webtest.tests.bugssuite;

import java.lang.reflect.TypeVariable;

import org.hawk.gwt.ppc.reflect.lang.GWTClassType;
import org.hawk.gwtppc.webtest.common.Asserts;
import org.hawk.gwtppc.webtest.common.Test;
import org.hawk.gwtppc.webtest.tests.mock.SelfReferenceGeneric;

public class Bug_20 implements Test {

	public void run() throws Throwable {
		TypeVariable<?>[] types = SelfReferenceGeneric.class.getTypeParameters();

		Asserts.assertNotNull(types);
		Asserts.assertEquals(1, types.length);
		Asserts.assertEquals("T", types[0].getName());
		Asserts.assertEquals(1, types[0].getBounds().length);
		Asserts.assertEquals(SelfReferenceGeneric.class, ((GWTClassType<?>) types[0].getBounds()[0]).toClass());
	}

	public String getName() {
		return "#20";
	}

}
